package controller

import (
	"mini-app/internal/app/web/service"

	"192.168.1.75/go-pkg/response"
	"github.com/gin-gonic/gin"
	"github.com/gin-gonic/gin/binding"
)

type Coupon struct{}

func (Coupon) CheckCode(c *gin.Context) {
	var params struct {
		SalesID string `json:"sales_id"`
		Code    string `json:"code"`
	}
	c.ShouldBindBodyWith(&params, binding.JSON)
	err := service.Coupon{}.CheckCode(c.Request.Context(), params.SalesID,
		params.Code)
	response.JSON(c, nil, err)
}
